package com.ytkj.digitalConstruction.dao.user;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.github.pagehelper.Page;
import com.ytkj.digitalConstruction.entity.user.User;
import com.ytkj.digitalConstruction.entity.user.UserGroupUser;
import com.ytkj.digitalConstruction.httpbean.user.req.UserListByUserGroupId;
import com.ytkj.digitalConstruction.httpbean.user.resbean.ReturnUserGroup;

/**
 * 用户组用户关联Mapper
 * @author iking
 *
 */
@Mapper
public interface UserGroupUserMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table u_user_group_user
     *
     * @mbg.generated Thu Dec 07 17:19:36 CST 2017
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table u_user_group_user
     *
     * @mbg.generated Thu Dec 07 17:19:36 CST 2017
     */
    int insert(UserGroupUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table u_user_group_user
     *
     * @mbg.generated Thu Dec 07 17:19:36 CST 2017
     */
    int insertSelective(UserGroupUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table u_user_group_user
     *
     * @mbg.generated Thu Dec 07 17:19:36 CST 2017
     */
    UserGroupUser selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table u_user_group_user
     *
     * @mbg.generated Thu Dec 07 17:19:36 CST 2017
     */
    int updateByPrimaryKeySelective(UserGroupUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table u_user_group_user
     *
     * @mbg.generated Thu Dec 07 17:19:36 CST 2017
     */
    int updateByPrimaryKey(UserGroupUser record);

    List<UserGroupUser> selectByUserGroupId(Integer userGroupId);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    int batchDelete(List<UserGroupUser> ids);

    /**
     * 批量新增
     * @param ids
     * @return
     */
    int batchInsert(List<UserGroupUser> ids);
    
    /**
     * 根据用户组id查询人员id
     * @ClassName: UserGroupUserMapper
     * @Description:
     * @param id
     * @return
     */
    List<Integer> selectByPrimaryKeys(Integer id);
	
    /**
     * 删除用户组下人员
     * @param usereId
     * @return
     */
    Integer deleteByUserGroupUserPrimaryKey(UserGroupUser userGroupUser);

    /**
     * 根据用户组Id查询人员列表
     * @param userGroupId
     * @return
     */
	Page<User> selectUserListByUserGroupId(Integer userGroupId);
	/**
	 * 根据用户名查询
	 * @param userGroupId
	 * @return
	 */
	Page<User> selectUserListByUserGroupName(UserListByUserGroupId userListByUserGroupId);
	/**
	 * 根据用户组id查询用户组人员
	 * @param userGroupId
	 * @param valueOf
	 * @return
	 */
	Integer selectByUserIdPrimaryKey(UserGroupUser userGroupUser);
/**
 * 根据用户id查询用户组id
 * @param userId
 * @return
 */
	List<ReturnUserGroup> selectByUserIdPrimaryKeys(Integer userId);

/**
 * 根据用户id查询用户组id
 * 
 * @param userId
 * @return
 */
List<Integer> selectUserGroupIdByUserId(Integer userId);

	
	
}